package zxzx.controller.AcctBsSgmtController;

import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import zxzx.controller.AcctBsSgmtService.AcctCredSgmtService;
import zxzx.controller.pojo.AcctCredSgmt;
import zxzx.controller.pojo.Result;

@RestController
@RequestMapping("acctCredSgmt")
public class AcctCredSgmtController {

	@Autowired
	private AcctCredSgmtService acctCredSgmtService;
	
	@RequestMapping("save")
	public Result  save(@RequestBody AcctCredSgmt acctCredSgmt) {
		acctCredSgmtService.save(acctCredSgmt);
		return new Result(true, "保存成功");
	}
	@RequestMapping("/findAll")
	public List<AcctCredSgmt> findAll(){
		return acctCredSgmtService.findAll();
	}
	@RequestMapping("/findOne/{id}")
	public Optional<AcctCredSgmt> findOne(@PathVariable Integer id){
		return acctCredSgmtService.findById(id);
	}
	@RequestMapping("/update")
	public Result update(@RequestBody AcctCredSgmt acctCredSgmt){
		acctCredSgmtService.update(acctCredSgmt);
		return new Result(true, "修改成功");
	}
	@RequestMapping("/createXml/{id}")
	public Result createXml(@PathVariable Integer id){
		acctCredSgmtService.createXml(id);
		return new Result(true, "生成成功");
	}
	
	
	
	
	
}
